<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>相邻外边距重叠问题(兄弟元素)</title>
    <style>
        .box1,
        .box2 {
            width: 200px;
            height: 200px;
        }

        .box1 {
            background-color: fuchsia;
            margin-bottom: 100px;
        }

        .box2 {
            overflow: hidden;
            background-color: honeydew;
            margin-top: 80px;
        }

        /* 
          为其中一个兄弟元素外面包一个div,然后在div中开启BFC
        */
        .ov{
            overflow: hidden;
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="ov">
        <div class="box2"></div>

    </div>

</body>

</html>